home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Gui4Cli / Dir / Dir.ren < prev    next >
Encoding:
Text File  |  1980-01-03  |  920 b   |  41 lines

  1. G4C
  2.  
  3. ; to be called from Dir.gc ONLY!
  4.  
  5. WinBig -1 -1 300 27 "Rename files"
  6. WinType 11110010
  7. varpath dir.gc
  8.  
  9. xOnLoad
  10. setscreen dir.ren $SCREEN
  11.  
  12. xOnOpen
  13. extract lv_file path dir    ; get path & store it
  14. update Dir.ren 1 $lv_file
  15. setgad dir.ren 1 on        ; to get cursor in textin gadget
  16.  
  17. xOnClose
  18. lvdir   refresh          ; re-read the dir.
  19. guiquit Dir.ren
  20.  
  21. xOnFail
  22. EZreq "Error in renaming file" OK ""
  23.  
  24. ;=========================> the text gad
  25.  
  26. xTextIn  5 5 290 18 "" ren_name "" 150
  27. gadid 1
  28. rename $lv_file $ren_name            ; rename the entry
  29. lvmulti off                    ; set it off
  30. extract ren_name FILE ren_temp            ; get the new file name
  31. extract ren_temp CLEAN ren_temp            ; clean it up
  32. lvput   $ren_temp                ; change list to the altered name
  33. lvmulti next                    ; get the next one
  34. if $lv_file = ""                ; quit when it's all over
  35.     guiclose Dir.ren
  36. else
  37.     update Dir.ren 1 $lv_file            ; put up the next entry for editing
  38.     setgad Dir.ren 1 on
  39. endif
  40.  
  41.